/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mygame;

import com.jme3.app.Application;
import com.jme3.asset.AssetManager;
import com.jme3.asset.AssetKey;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Box;
import com.jme3.scene.shape.Sphere;

/**
 *
 * @author gazelle
 */
public class Bullet{
    AssetManager asm;// = new AssetManager();
    
    private Spatial bulletSpatial;
    private ColorRGBA color;
    private int bulletSpeed;
    private int distanceTravelled;
    private int distanceToTravel;
    private String bulletType;
    private Vector3f direction;
    private Vector3f spot;
        
    
    public Bullet()
    {
        
    }
    
    public Bullet ( Material matObj,Vector3f a, Vector3f dir)
    {
        this.spot = a;
        
        //this.assetManager.loadAsset(new AssetKey("CaptainsChair/Materials/red.j3m"));
        
        Sphere sphere = new Sphere(30, 30, 1f);
        this.bulletSpatial = new Geometry("bullet", sphere );
        
        //this.assetManager.loadAsset(new AssetKey("CaptainsChair/Materials/red.j3m"));
        this.bulletSpatial.setMaterial(matObj);
        this.bulletSpatial.setLocalTranslation(spot);
        this.bulletType = "sBULLET";
        this.bulletSpeed = 5;
        this.distanceToTravel = 10000;
        this.distanceTravelled = 0;
        this.direction = dir;
        
    }
    
    public int DistanceTravelled(){return distanceTravelled;}
    
    public int DistanceToTravel(){return distanceToTravel;}
    
    public Vector3f BulletDirection(){return direction;}
    
    public Spatial getSpatial(){return bulletSpatial;}
    
    public int getSpeed(){return bulletSpeed;}
    
    public void setChange(){
        ++distanceTravelled;
        //bulletSpatial.setLocalTranslation(
          //      spot.add(direction));
    }

    
    public void simpleInitApp() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
    

    
}
